package com.sxy.demo.sxy;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统配置VO
 */
@Data
@TableName("sys_config")
public class SysConfig implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    public static enum ModularCodeEnum {
        SNS_SERVICE,
        PAY_SERVICE,
        AGENT_SERVICE,
        ASSET_SERVICE,
        COMMON_SERVICE,
        HOMESTAY_SERVICE,
        HOUSE_SERVICE,
        MALL_SERVICE,
        MESSAGE_SERVICE,
        ORDER_SERVICE,
        REPORT_SERVICE,
        SEARCH_SERVICE,
        TASK_SERVICE,
        USER_SERVICE,
        MIXTURE_SERVICE,
        RETAIL_SERVICE,
        HFMALL_API,
        ALIYUN_DYNAMIC_AUDIT,
        ALIYUN_ACCOUNT_KEY,
        COUPON_SERVICE,
        SCM_SERVICE,
        RMS_MEMBER
        ;


        public static ModularCodeEnum getModularCodeBy(String modul) {
            for (ModularCodeEnum value : values()) {
                if (value.name().equals(modul)) {
                    return value;
                }
            }
            return null;
        }
    }

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 模块
     */
    private ModularCodeEnum modularCode;
    /**
     * 功能
     */
    private String functionCode;
    /**
     * 配置code
     */
    private String kindCode;
    /**
     * 同一code不同时间段对应值(1,2,3...)。
     */
    private int kindStep;
    /**
     * 配置值
     */
    private String configValue;
    /**
     * 生效时间
     */
    private Date effectiveDatetime;
    /**
     * 失效时间
     */
    private Date expiredDatetime;
    /**
     * 标注说明
     */
    private String remarks;
    private Date createDatetime;
    private Date updateDatetime;
    private String otherInfo;

    public static final String Modular_code = "modular_code";
	public static final String Function_code = "function_code";
	public static final String Kind_code = "kind_code";
	public static final String Kind_step = "kind_step";
	public static final String Effective_datetime = "effective_datetime";
	public static final String Expired_datetime = "expired_datetime";

}
